

from bs4 import BeautifulSoup
import requests

r= requests.get('http://www.baidu.com')
r.encoding='utf-8'

soup= BeautifulSoup(r.text,'html.parser')
print(soup.title)
print(1,dir(soup.title))
print(2,dir(soup))
print(3,soup.title.text)
print(3,type(soup))
#print(3,soup.prettify())
print(4,soup.head)
print(5,soup.p)
print(6,soup.a)


